package com.gp.geits.exception;

import com.gp.geits.Enum.ResultCodeEnum;
import lombok.Data;

/**
 * @author lzf
 * @date 2022-03-09 15:47
 */
@Data
public class GETSException extends RuntimeException{
    private Integer code;

    public GETSException(String message, Integer code) {
        super(message);
        this.code = code;
    }

    public GETSException(ResultCodeEnum resultCodeEnum){
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }

    @Override
    public String toString() {
        return "GETSException{" +
                "code=" + code +
                ",message" + this.getMessage() +
                '}';
    }
}
